package com.sjh.lib_app.statusMananger.statusView

import android.content.Context
import android.graphics.Color
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import android.widget.TextView
import com.sjh.lib_app.statusMananger.StatusManager
import com.sjh.lib_app.statusMananger.StatusView


/**
 *
 * @author Extends
 * @date 2020/1/14/014
 */
class EmptyView : StatusView() {

    companion object {
        const val ROOT = "com.yzjt.lib_app.statusMananger.statusView.EmptyView.FrameLayout"
    }

    /**
     * 创建布局
     */
    override fun createView(context: Context, statusManager: StatusManager): View {
        return FrameLayout(context).apply {
            setBackgroundColor(Color.YELLOW)
            val showInfo = TextView(context)
            tvMessage = showInfo
            layoutParams = ViewGroup.LayoutParams(-1, -1)
            showInfo.apply { text = "空布局状态" }
            setOnClickListener {
                statusManager.setOnClickEvent(ROOT)
            }
        }
    }
}